# Bazel modules for the IC build.
# NOTE: Some dependencies are still listed in the WORKSPACE file. See WORKSPACE
# for details.

module(
    name = "ic",
)

ext = use_extension("@rules_buf//buf:extensions.bzl", "buf")
use_repo(ext, "rules_buf_toolchains")

register_toolchains("@rules_buf_toolchains//:all")

# General Bazel helpers
bazel_dep(name = "bazel_skylib", version = "1.8.2")
bazel_dep(name = "aspect_bazel_lib", version = "2.9.0")
bazel_dep(name = "rules_shell", version = "0.6.1")

bazel_dep(name = "buildifier_prebuilt", version = "8.2.0.2", dev_dependency = True)

# CC dependencies (for C libs like miracl-core, etc)
bazel_dep(name = "rules_cc", version = "0.2.8")
bazel_dep(name = "platforms", version = "1.0.0")
bazel_dep(name = "hermetic_cc_toolchain", version = "4.0.1")
archive_override(
    module_name = "hermetic_cc_toolchain",
    integrity = "sha256-ziFGNqyR/zQFkoqxcOdCAbAYnhNxXXObBfUjxO9LGoM=",
    patch_strip = 1,
    patches = [
        "//bazel:hermetic_cc_toolchain_strip.patch",
        "//bazel:hermetic_cc_toolchain_cache_dir.patch",
    ],
    strip_prefix = "hermetic_cc_toolchain-32c6f9ec9e0b3aebfa92950e7019f1275390bda1",
    urls = ["https://github.com/uber/hermetic_cc_toolchain/archive/32c6f9ec9e0b3aebfa92950e7019f1275390bda1.tar.gz"],
)

# configure/make dependencies
bazel_dep(name = "rules_foreign_cc", version = "0.14.0")

register_toolchains(
    "@rules_foreign_cc//toolchains:preinstalled_pkgconfig_toolchain",
    "@rules_foreign_cc//toolchains:preinstalled_make_toolchain",
)

# Use HEAD to include this commit which is needed for preinstalled toolchains to work
# https://github.com/bazel-contrib/rules_foreign_cc/commit/d03f7ae79ddda0ad228b17048b9e2dc0efcc8e95
#
# Use a patch to work around determinism issues in make & pkgconfig toolchains
# https://github.com/bazel-contrib/rules_foreign_cc/issues/1313
archive_override(
    module_name = "rules_foreign_cc",
    integrity = "sha384-bTtlZejENu+3rnOsCg1nmSZJl54++7nB0zgzWT+jtZJ1QyMRwkV4ieOaeORQTdjY",
    patch_strip = 1,
    patches = ["//bazel:rules_foreign_cc.patch"],
    strip_prefix = "rules_foreign_cc-77d4483fadbb1b7bcace18ed8e8e87e8791050f6",
    urls = ["https://github.com/bazelbuild/rules_foreign_cc/archive/77d4483fadbb1b7bcace18ed8e8e87e8791050f6.tar.gz"],
)

# Misc tools

bazel_dep(name = "pigz", version = "2.8")  # (parallel) gzip

# Rust

include("//bazel:rust.MODULE.bazel")

# Python dependencies

bazel_dep(name = "rules_python", version = "0.35.0")

python_version = "3.12"

python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(python_version = python_version)

pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
    hub_name = "python_deps",
    python_version = python_version,
    requirements_lock = "//:requirements.txt",
)
use_repo(pip, "python_deps")

# Protobuf dependencies
bazel_dep(
    name = "protobuf",
    version = "29.1",
    # We rename it to keep the legacy name used throughout our bazel files
    repo_name = "com_google_protobuf",
)

# protobuf linter
bazel_dep(name = "rules_buf", version = "0.5.2")

# Go dependencies

bazel_dep(name = "rules_go", version = "0.50.1")
bazel_dep(name = "gazelle", version = "0.38.0")

go_deps = use_extension("@gazelle//:extensions.bzl", "go_deps")
go_deps.from_file(go_mod = "//:go.mod")

# All direct go deps
go_deps.module(
    path = "github.com/fatih/color",
    sum = "h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w=",
    version = "v1.13.0",
)
go_deps.module(
    path = "github.com/spf13/cobra",
    sum = "h1:o94oiPyS4KD1mPy2fmcYYHHfCxLqYjJOhGsCHFZtEzA=",
    version = "v1.6.1",
)
use_repo(
    go_deps,
    "com_github_fatih_color",
    "com_github_google_go_cmp",
    "com_github_schollz_closestmatch",
    "com_github_spf13_cobra",
    "com_github_stretchr_testify",
)

# Docker/OCI & archive rules with image definitions
# Mirror image to GHCR if image is in DockerHub:
#   1st PR: add it to the list .github/workflows/container-mirror-images.json
#   2nd PR: add it below

bazel_dep(name = "rules_pkg", version = "1.0.1")
bazel_dep(name = "rules_oci", version = "2.0.0")

oci = use_extension("@rules_oci//oci:extensions.bzl", "oci")

# file server used in tests
oci.pull(
    name = "static-file-server",
    image = "ghcr.io/dfinity/halverneus/static-file-server@sha256:9e46688910b1cf9328c3b55784f08a63c53e70a276ccaf76bfdaaf2fbd0019fa",
    platforms = [
        "linux/amd64",
    ],
)
use_repo(oci, "static-file-server", "static-file-server_linux_amd64")

# bitcoin container used in test
oci.pull(
    name = "bitcoind",
    image = "ghcr.io/dfinity/kylemanna/bitcoind@sha256:17c7dd21690f3be34630db7389d2f0bff14649e27a964afef03806a6d631e0f1",
    platforms = [
        "linux/amd64",
    ],
)
use_repo(oci, "bitcoind", "bitcoind_linux_amd64")

# dogecoin container used in test
oci.pull(
    name = "dogecoind",
    image = "ghcr.io/dfinity/fiftysix/dogecoin-core@sha256:13c8b150b759eed9e11ebaf0edfdf998022bfd622164c8768d7057b43e4e156c",
    platforms = [
        "linux/amd64",
    ],
)
use_repo(oci, "dogecoind", "dogecoind_linux_amd64")

# IC HTTP Gateway container used in tests
oci.pull(
    name = "ic_gatewayd",
    image = "ghcr.io/dfinity/ic-gateway@sha256:0a25e9da712202966447919dfce145f9af5df62e282f2dfe8a7ea226a44b077a",
    platforms = [
        "linux/amd64",
    ],
)
use_repo(oci, "ic_gatewayd", "ic_gatewayd_linux_amd64")

# foundry container used in test
oci.pull(
    name = "foundry",
    image = "ghcr.io/foundry-rs/foundry@sha256:8f9dd6d4c498538b3aa3999758520bca24a41273163b0c7295ed53b1a6062f30",  # v0.3.0 https://github.com/foundry-rs/foundry/pkgs/container/foundry/391862899?tag=v0.3.0
    platforms = [
        "linux/amd64",
    ],
)
use_repo(oci, "foundry", "foundry_linux_amd64")

# nginx-proxy container used in test
oci.pull(
    name = "nginx-proxy",
    image = "ghcr.io/dfinity/nginxproxy/nginx-proxy@sha256:c9ba1ba8a93223305a8bce2ae09024060797698121cd01a48e5cd7462b22faa1",
    platforms = [
        "linux/amd64",
    ],
)
use_repo(oci, "nginx-proxy", "nginx-proxy_linux_amd64")

# Used by tests
oci.pull(
    name = "jaeger",
    image = "ghcr.io/dfinity/jaegertracing/all-in-one@sha256:836e9b69c88afbedf7683ea7162e179de63b1f981662e83f5ebb68badadc710f",
    platforms = [
        "linux/amd64",
    ],
)
use_repo(oci, "jaeger", "jaeger_linux_amd64")

oci.pull(
    name = "vector-with-log-fetcher",
    image = "ghcr.io/dfinity/dre/log-fetcher@sha256:61696bcce605f4ef7b86f606077b47675191ed099f7559b7746281d3bb2a3fba",
    platforms = [
        "linux/amd64",
    ],
)
use_repo(oci, "vector-with-log-fetcher", "vector-with-log-fetcher_linux_amd64")

# Used by tests
oci.pull(
    name = "minica",
    image = "ghcr.io/dfinity/ryantk/minica@sha256:c67e2c1885d438b5927176295d41aaab8a72dd9e1272ba85054bfc78191d05b0",
    platforms = ["linux/amd64"],
)
use_repo(oci, "minica", "minica_linux_amd64")

# used by rosetta image
oci.pull(
    name = "rust_base",
    image = "gcr.io/distroless/cc-debian12@sha256:3310655aac0d85eb9d579792387af1ff3eb7a1667823478be58020ab0e0d97a8",
    platforms = ["linux/amd64"],
)
use_repo(oci, "rust_base", "rust_base_linux_amd64")

# used in various places as base
oci.pull(
    name = "ubuntu_base",
    image = "ghcr.io/dfinity/ubuntu@sha256:6015f66923d7afbc53558d7ccffd325d43b4e249f41a6e93eef074c9505d2233",
    platforms = ["linux/amd64"],
)
use_repo(oci, "ubuntu_base", "ubuntu_base_linux_amd64")

# used by boundary node tests
oci.pull(
    name = "coredns",
    image = "ghcr.io/dfinity/coredns/coredns@sha256:be7652ce0b43b1339f3d14d9b14af9f588578011092c1f7893bd55432d83a378",
    platforms = ["linux/amd64"],
)
use_repo(oci, "coredns", "coredns_linux_amd64")

# used by custom domains tests
oci.pull(
    name = "pebble",
    image = "ghcr.io/dfinity/letsencrypt/pebble@sha256:fc5a537bf8fbc7cc63aa24ec3142283aa9b6ba54529f86eb8ff31fbde7c5b258",
    platforms = ["linux/amd64"],
)
use_repo(oci, "pebble", "pebble_linux_amd64")

oci.pull(
    name = "python3",
    image = "ghcr.io/dfinity/library/python@sha256:0a56f24afa1fc7f518aa690cb8c7be661225e40b157d9bb8c6ef402164d9faa7",
    platforms = ["linux/amd64"],
)
use_repo(oci, "python3", "python3_linux_amd64")

oci.pull(
    name = "alpine_openssl",
    image = "ghcr.io/dfinity/alpine/openssl@sha256:cf89651f07a33d2faf4499f72e6f8b0ee2542cd40735d51c7e75b8965c17af0e",
    platforms = ["linux/amd64"],
)
use_repo(oci, "alpine_openssl", "alpine_openssl_linux_amd64")

# Ubuntu snapshots

bazel_dep(name = "rules_distroless", version = "0.3.8")

apt = use_extension("@rules_distroless//apt:extensions.bzl", "apt")

# Packageset based on an Ubuntu noble snapshot, see manifest file
# for details
# To update, comment out the `lock` field below and run:
#   bazel run @noble//:lock
apt.install(
    name = "noble",
    lock = "//bazel:noble.lock.json",
    manifest = "//bazel:noble.yaml",
)
use_repo(apt, "noble")

# Single files & archives that are not bazel modules

http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_file = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_file")

http_jar = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_jar")

# TLA+ tools
http_jar(
    name = "tlaplus_community_modules",
    sha256 = "109e0828d192c33703d5cbc50b5b6e128acd816565616e27b3855949c7baba9c",
    url = "https://github.com/tlaplus/CommunityModules/releases/download/202302091937/CommunityModules-202302091937.jar",
)

http_jar(
    name = "tlaplus_community_modules_deps",
    sha256 = "762c4bdc25a0cb67043411c7f4f062cc2c038631c9c569539df880e0e78d5cf4",
    url = "https://github.com/tlaplus/CommunityModules/releases/download/202302091937/CommunityModules-deps-202302091937.jar",
)

# Apalache model checker for TLA+
http_archive(
    name = "tla_apalache",
    build_file_content = """
package(default_visibility = ["//visibility:public"])

exports_files([ "bin/apalache-mc" ])
    """,
    sha256 = "173a683707c2a639c955328746461cad39e4b8a5adff95e156ce3bf376ba293b",
    strip_prefix = "apalache-0.44.11",
    url = "https://github.com/apalache-mc/apalache/releases/download/v0.44.11/apalache-0.44.11.tgz",
)

# Official WebAssembly test suite.
# To be used for testing libraries that handle canister Wasm code.
http_archive(
    name = "wasm_spec_testsuite",
    build_file = "@//third_party:BUILD.wasmtestsuite.bazel",
    sha256 = "9afc0e7c250b5f0dcf32e9a95860b99a392ab78a653fcf3705778e8a9357f3c4",
    strip_prefix = "testsuite-4f77306bb63151631d84f58dedf67958eb9911b9",
    url = "https://github.com/WebAssembly/testsuite/archive/4f77306bb63151631d84f58dedf67958eb9911b9.tar.gz",
)

# Asset canister

http_file(
    name = "asset_canister",
    downloaded_file_path = "assetstorage.wasm.gz",
    sha256 = "1286960c50eb7a773cfb5fdd77cc238588f39e21f189cc3eb0f35199a99b9c7e",
    url = "https://github.com/dfinity/sdk/raw/0.14.2/src/distributed/assetstorage.wasm.gz",
)

# Asset canister that certifies long assets chunk-wise

http_file(
    name = "long_asset_canister",
    downloaded_file_path = "http_gateway_canister_custom_assets.wasm.gz",
    sha256 = "eedcbf986c67fd4ebe3042094604a9a5703e825e56433e2509a6a4d0384ccf95",
    url = "https://github.com/dfinity/http-gateway/raw/refs/heads/main/examples/http-gateway/canister/http_gateway_canister_custom_assets.wasm.gz",
)

# Old version of wallet canister

http_file(
    name = "wallet_canister_0.7.2",
    downloaded_file_path = "wallet.wasm",
    sha256 = "1404b28b1c66491689b59e184a9de3c2be0dbdd75d952f29113b516742b7f898",
    url = "https://github.com/dfinity/sdk/raw/0.7.2/src/distributed/wallet.wasm",
)

# Bitcoin canister

http_file(
    name = "btc_canister",
    downloaded_file_path = "ic-btc-canister.wasm.gz",
    sha256 = "f18d28cbebf49cbd2b6a3dba8f6da1399b95714c7cf100d3fb31ba9c33941daa",
    url = "https://github.com/dfinity/bitcoin-canister/releases/download/release%2F2024-07-28/ic-btc-canister.wasm.gz",
)

# Bitcoin Adapter Mainnet Data for Integration Test

# The files have been generated by syncing bitcoind client, followed
# by requesting all the desired data using a bash script, such as:
#
# declare -a headers=()
# for h in {0..800000}
# do
#     hash=$(bitcoin-cli getblockhash $h)
#     header=$(bitcoin-cli getblockheader $hash | jq '{version, prev_blockhash:.previousblockhash, merkle_root:.merkleroot, time, bits, nonce}')
#     headers+=("$header")
# done
# echo "[" $(IFS=,; echo "${headers[*]}") "]"

# Contains the first 800_000 headers of the Bitcoin mainnet blockchain.
http_file(
    name = "bitcoin_adapter_mainnet_headers",
    downloaded_file_path = "mainnet_headers_800k.json.gz",
    sha256 = "fb58cd3c0e2efe298eeb96751ae2276e938b39e2f1d9760ea47a9f3a8288d214",
    url = "https://download.dfinity.systems/testdata/mainnet_headers_800k.json.gz",
)

# Contains the first 800_000 headers of the Dogecoin mainnet blockchain with auxiliary proof-of-work.
http_file(
    name = "doge_headers_800k_mainnet_auxpow",
    downloaded_file_path = "doge_headers_800k_mainnet_auxpow.json.gz",
    sha256 = "e138d7c59d237d0eea70943b60038b8755d9aa1f04bc94f315a74775cf8bfc2d",
    url = "http://download.dfinity.systems/testdata/doge/doge_headers_800k_mainnet_auxpow.json.gz",
)

# Contains blocks 350_990 to 350_999 (inclusive) of the Bitcoin mainnet blockchain.
http_file(
    name = "bitcoin_adapter_mainnet_blocks",
    downloaded_file_path = "blocks.json.gz",
    sha256 = "4ba1e7d0b4a2fea5692bb4c79a4c9e077325312a50facef13256ba8d45bc8f2a",
    url = "https://download.dfinity.systems/testdata/blocks.json.gz",
)

# Contains the first 800_000 headers of the Bitcoin testnet blockchain.
http_file(
    name = "bitcoin_adapter_testnet_headers",
    downloaded_file_path = "testnet_headers.json.gz",
    sha256 = "c01542d816d9631a7e59210aea29c1d46ed805b0bcbfd9e067d8d53a5e5919c8",
    url = "https://download.dfinity.systems/testdata/testnet_headers.json.gz",
)

# Contains blocks 350_990 to 350_999 (inclusive) of the Bitcoin testnet blockchain.
http_file(
    name = "bitcoin_adapter_testnet_blocks",
    downloaded_file_path = "testnet_blocks.json.gz",
    sha256 = "ae57b5b58d8a1e89545c0caedeb114d0dd179e0c5fd4a44e43321b2cdbac74fb",
    url = "https://download.dfinity.systems/testdata/testnet_blocks.json.gz",
)

# Contains blocks 0 to 700_000 (inclusive) of the Dogecoin mainnet blockchain.
http_file(
    name = "dogecoin_adapter_mainnet_headers",
    downloaded_file_path = "doge_headers_mainnet_0_700000_raw.csv",
    sha256 = "42c9f72499308f847312cae8fdb5148dcaed71120041a60d336f5628dd93e1fc",
    url = "https://download.dfinity.systems/testdata/doge/doge_headers_mainnet_0_700000_raw.csv",
)

# Contains blocks 1 to 15_000 (inclusive) of the Dogecoin mainnet blockchain in parsed format.
http_file(
    name = "dogecoin_adapter_mainnet_headers_parsed",
    downloaded_file_path = "doge_headers_mainnet_1_15000_parsed.csv",
    sha256 = "a76d47758cf8251e1a524510cd2372287888784f2587cea0834b6af9582b6448",
    url = "https://download.dfinity.systems/testdata/doge/doge_headers_mainnet_1_15000_parsed.csv",
)

# Contains blocks 521_337 to 536_336 (inclusive) of the Dogecoin mainnet blockchain in parsed format.
# Contains 14_955 AuxPow headers out of 15,000 headers.
http_file(
    name = "dogecoin_adapter_mainnet_headers_auxpow_parsed",
    downloaded_file_path = "doge_headers_mainnet_521337_536336_auxpow_parsed.csv",
    sha256 = "248e36cf7962cb0d55f9e8f20d2beecee9611045713d118a6ad6ff8c98cd2070",
    url = "https://download.dfinity.systems/testdata/doge/doge_headers_mainnet_521337_536336_auxpow_parsed.csv",
)

# Contains blocks 0 to 2_000_000 (inclusive) of the Dogecoin testnet blockchain.
http_file(
    name = "dogecoin_adapter_testnet_headers",
    downloaded_file_path = "doge_headers_testnet_0_2000000_raw.csv",
    sha256 = "feefd751b10c174622f9a81bb0777eac035936a6a6f4ec3604fdcfa1201b0e42",
    url = "https://download.dfinity.systems/testdata/doge/doge_headers_testnet_0_2000000_raw.csv",
)

# Contains blocks 1 to 15_000 (inclusive) of the Dogecoin testnet blockchain in parsed format.
http_file(
    name = "dogecoin_adapter_testnet_headers_parsed",
    downloaded_file_path = "doge_headers_testnet_1_15000_parsed.csv",
    sha256 = "39d12178923b95e4f98257aaf537336e42ce1940b6b6c69277164c8c556fd15e",
    url = "https://download.dfinity.systems/testdata/doge/doge_headers_testnet_1_15000_parsed.csv",
)

# Contains blocks 293_100 to 308_099 (inclusive) of the Dogecoin testnet blockchain in parsed format.
# Contains 14_746 AuxPow headers out of 15_000 headers.
http_file(
    name = "dogecoin_adapter_testnet_headers_auxpow_parsed",
    downloaded_file_path = "doge_headers_testnet_293100_308099_auxpow_parsed.csv",
    sha256 = "2aeb78d9564153607900a8e86d2e0fae72fb9fda362c2ce475e60c5d3e43f5e2",
    url = "https://download.dfinity.systems/testdata/doge/doge_headers_testnet_293100_308099_auxpow_parsed.csv",
)

# Internet Identity canister (test build)

http_file(
    name = "ii_dev_canister",
    downloaded_file_path = "internet_identity_dev.wasm.gz",
    sha256 = "2357d822cd451f25c0edab3e45db52ab140a2ac8c4b0170201c78acc5bc11779",
    url = "https://github.com/dfinity/internet-identity/releases/download/release-2024-05-13/internet_identity_dev.wasm.gz",
)

# NNS frontend dapp canister

http_file(
    name = "nns_dapp_canister",
    downloaded_file_path = "nns_dapp_canister.wasm.gz",
    sha256 = "46e5cdad3c77465e938c6ddcc5f41f0ed0b22fd0efc4c9832c3bbd5eee656b0e",
    url = "https://github.com/dfinity/nns-dapp/releases/download/nightly-2025-09-03/nns-dapp_test.wasm.gz",
)

# SNS aggregator canister

http_file(
    name = "sns_aggregator",
    downloaded_file_path = "sns_aggregator_dev.wasm.gz",
    sha256 = "ad1b1a3faa5f5db553198ee68f36361b173cf6cfdc064f7727b2c02a81020c7b",
    url = "https://github.com/dfinity/nns-dapp/releases/download/nightly-2025-09-03/sns_aggregator_dev.wasm.gz",
)

# KongSwap backend canister

http_file(
    name = "kong_backend_canister",
    downloaded_file_path = "kong_backend.wasm.gz",
    sha256 = "bed9a193158348843c8661616c65b152f57f875863f75dad3b75627ad6a2b4fc",
    url = "https://github.com/KongSwap/kong/raw/4bf8f99df53dbd34bef0e55ab6364d85bb31c71a/wasm/kong_backend.wasm.gz",
)

# SNS-KongSwap Adaptor canister (an SNS extension of the TreasuryManager kind)

http_file(
    name = "kongswap-adaptor-canister",
    downloaded_file_path = "kongswap-adaptor-canister.wasm.gz",
    sha256 = "1c07ceba560e7bcffa43d1b5ae97db81151854f068b707c1728e213948212a6c",
    url = "https://github.com/dfinity/sns-kongswap-adaptor/releases/download/v1.0.0/kongswap-adaptor-canister.wasm.gz",
)

# Cycles Ledger canister

http_file(
    name = "cycles-ledger.wasm.gz",
    downloaded_file_path = "cycles-ledger.wasm.gz",
    sha256 = "d2aacbd214f20d752fd1696c2e36d7eceaafe07b932b3ae9e7e5564d1bda0178",
    url = "https://github.com/dfinity/cycles-ledger/releases/download/cycles-ledger-v1.0.3/cycles-ledger.wasm.gz",
)

# Subnet Rental Canister

http_file(
    name = "subnet_rental_canister",
    downloaded_file_path = "subnet_rental_canister.wasm.gz",
    sha256 = "860d30bc74facd4287b7af766004344e4cea4989ae0bf5408b4fb70ff337bc42",
    url = "https://github.com/dfinity/subnet-rental-canister/releases/download/0.3.0/subnet_rental_canister.wasm.gz",
)

# Financial Integration artifacts for upgrade testing

# ic-icrc1-ledger releases without ICRC-3
http_file(
    name = "ic-icrc1-ledger-wo-icrc-3.wasm.gz",
    sha256 = "dc42ffd30d6616068b2dd10023ab0ff8d49b0cbce7582c4673c18caa7412dd3a",
    url = "https://download.dfinity.systems/ic/300dc603a92b5f70dae79229793c902f346af3cc/canisters/ic-icrc1-ledger.wasm.gz",
)

http_file(
    name = "ic-icrc1-ledger-wo-icrc-3-u256.wasm.gz",
    sha256 = "8730fd2aa3b9fe67468fc5e853436f618d0b16be34ff30d7e6492eac55f78d90",
    url = "https://download.dfinity.systems/ic/300dc603a92b5f70dae79229793c902f346af3cc/canisters/ic-icrc1-ledger-u256.wasm.gz",
)

# XC artifacts for testing

# EVM RPC canister

http_file(
    name = "evm_rpc.wasm.gz",
    sha256 = "5dbcce40bf3020cfc2d869373a8f3094785c80882fc4d52980814aa89abd541a",
    url = "https://github.com/internet-computer-protocol/evm-rpc-canister/releases/download/evm_rpc-v2.6.0/evm_rpc.wasm.gz",
)

http_archive(
    name = "bitcoin_core_linux_x86",
    build_file_content = """
package(default_visibility = ["//visibility:public"])
filegroup(
    name = "bitcoind",
    srcs = ["bin/bitcoind"],
)
""",
    sha256 = "2a6974c5486f528793c79d42694b5987401e4a43c97f62b1383abf35bcee44a8",
    strip_prefix = "bitcoin-27.0",
    urls = [
        "https://bitcoin.org/bin/bitcoin-core-27.0/bitcoin-27.0-x86_64-linux-gnu.tar.gz",
        "https://bitcoincore.org/bin/bitcoin-core-27.0/bitcoin-27.0-x86_64-linux-gnu.tar.gz",
    ],
)

http_archive(
    name = "bitcoin_core_linux_aarch64",
    build_file_content = """
package(default_visibility = ["//visibility:public"])
filegroup(
    name = "bitcoind",
    srcs = ["bin/bitcoind"],
)
""",
    sha256 = "cb35e250ae9d0328aa90e7aad0b877ed692597420a1092e8ab1a5dd756209722",
    strip_prefix = "bitcoin-27.0",
    urls = [
        "https://bitcoin.org/bin/bitcoin-core-27.0/bitcoin-27.0-aarch64-linux-gnu.tar.gz",
        "https://bitcoincore.org/bin/bitcoin-core-27.0/bitcoin-27.0-aarch64-linux-gnu.tar.gz",
    ],
)

http_archive(
    name = "bitcoin_core_darwin_x86",
    build_file_content = """
package(default_visibility = ["//visibility:public"])
filegroup(
    name = "bitcoind",
    srcs = ["bin/bitcoind"],
)
""",
    sha256 = "e1efd8c4605b2aabc876da93b6eee2bedd868ce7d1f02b0220c1001f903b3e2c",
    strip_prefix = "bitcoin-27.0",
    urls = [
        "https://bitcoin.org/bin/bitcoin-core-27.0/bitcoin-27.0-x86_64-apple-darwin.tar.gz",
        "https://bitcoincore.org/bin/bitcoin-core-27.0/bitcoin-27.0-x86_64-apple-darwin.tar.gz",
    ],
)

http_archive(
    name = "bitcoin_core_darwin_arm64",
    build_file_content = """
package(default_visibility = ["//visibility:public"])
filegroup(
    name = "bitcoind",
    srcs = ["bin/bitcoind"],
)
""",
    sha256 = "1d9d9b837297a73fc7a3b1cfed376644e3fa25c4e1672fbc143d5946cb52431d",
    strip_prefix = "bitcoin-27.0",
    urls = [
        "https://bitcoin.org/bin/bitcoin-core-27.0/bitcoin-27.0-arm64-apple-darwin.tar.gz",
        "https://bitcoincore.org/bin/bitcoin-core-27.0/bitcoin-27.0-arm64-apple-darwin.tar.gz",
    ],
)

http_archive(
    name = "dogecoin_core_linux_x86",
    build_file_content = """
package(default_visibility = ["//visibility:public"])
filegroup(
    name = "dogecoind",
    srcs = ["bin/dogecoind"],
)
""",
    sha256 = "4f227117b411a7c98622c970986e27bcfc3f547a72bef65e7d9e82989175d4f8",
    strip_prefix = "dogecoin-1.14.9",
    url = "https://github.com/dogecoin/dogecoin/releases/download/v1.14.9/dogecoin-1.14.9-x86_64-linux-gnu.tar.gz",
)

http_archive(
    name = "openssl",
    build_file = "@//third_party:BUILD.openssl.bazel",
    integrity = "sha256-4V3agv4v6BOdwqwho21MoB1TE8dfmfRsTooncJtylL8=",
    strip_prefix = "openssl-3.4.0",
    urls = ["https://github.com/openssl/openssl/releases/download/openssl-3.4.0/openssl-3.4.0.tar.gz"],
)

http_archive(
    name = "libfuzzer",
    build_file = "@//third_party:BUILD.libfuzzer.bazel",
    integrity = "sha256-CLw4JzN3fdo8liWeNzL/lsHfmNBHDE+FsWMnTq5of08=",
    strip_prefix = "llvm-project-llvmorg-20.1.0/compiler-rt/lib/fuzzer",
    urls = ["https://github.com/llvm/llvm-project/archive/refs/tags/llvmorg-20.1.0.tar.gz"],
)

http_archive(
    name = "jemalloc",
    build_file = "@//third_party:BUILD.jemalloc.bazel",
    sha256 = "ef6f74fd45e95ee4ef7f9e19ebe5b075ca6b7fbe0140612b2a161abafb7ee179",
    strip_prefix = "jemalloc-5.3.0",
    urls = [
        "https://github.com/jemalloc/jemalloc/archive/refs/tags/5.3.0.tar.gz",
    ],
)

http_archive(
    name = "lmdb",
    build_file = "@//third_party:BUILD.lmdb.bazel",
    sha256 = "d424c1eb841d0b78b91994b6ddef31aa6a3300727b9d9e7868033edfca0f142c",
    strip_prefix = "openldap-OPENLDAP_REL_ENG_2_5_9/libraries/liblmdb",
    urls = [
        "https://github.com/openldap/openldap/archive/refs/tags/OPENLDAP_REL_ENG_2_5_9.zip",
    ],
)

http_file(
    name = "bitcoin_example_canister",
    downloaded_file_path = "basic_bitcoin.wasm.gz",
    sha256 = "e5560c9f7ca3f06c62b0169ffdc5b568ce0eb48e600a1ab893fdeb7414117dc2",
    url = "https://github.com/dfinity/examples/releases/download/rust-basic-bitcoin-25-10-10/basic_bitcoin.wasm.gz",
)

http_file(
    name = "dogecoin_example_canister",
    downloaded_file_path = "basic_dogecoin.wasm",
    sha256 = "2eacb8de00dc2fc9bd43f7a5a8a4cd79c61c40ed3f761df84105a4a450f9e0c4",
    url = "https://github.com/dfinity/dogecoin-canister/releases/download/example%2Fbasic-dogecoin%2F2025-11-12/basic_dogecoin.wasm",
)

http_file(
    name = "pocket-ic-mainnet-gz",
    # Calculate this hash using:
    # git checkout $revision
    # ci/container/container-run.sh
    # bazel build //publish/binaries:pocket-ic.gz
    # sha256sum bazel-bin/publish/binaries/pocket-ic.gz
    sha256 = "dd8a95dd5a784e9b7c8c79fc4fa3a5c97d449f9666afe57aefa960aef0d68b8c",
    url = "https://github.com/dfinity/pocketic/releases/download/10.0.0/pocket-ic-x86_64-linux.gz",
)

## Rosetta CLI

http_archive(
    name = "rosetta-cli-x86_64-darwin",
    build_file = "@//third_party:BUILD.rosetta-cli.bazel",
    sha256 = "6426d69d8ce6851a00eb47c4b3bb5a5f2f792daca58a58d077ac5ade7c07f42b",
    url = "https://github.com/coinbase/mesh-cli/releases/download/v0.10.3/rosetta-cli-0.10.3-darwin-amd64.tar.gz",
)

http_archive(
    name = "rosetta-cli-aarch64-darwin",
    build_file = "@//third_party:BUILD.rosetta-cli.bazel",
    sha256 = "41eaa23bc2a34568549e7c0d99c3471fd0c20959ffb7a1e9fd2acc658f500b20",
    url = "https://github.com/coinbase/mesh-cli/releases/download/v0.10.3/rosetta-cli-0.10.3-darwin-arm64.tar.gz",
)

http_archive(
    name = "rosetta-cli-x86_64-linux",
    build_file = "@//third_party:BUILD.rosetta-cli.bazel",
    sha256 = "1ea96b427dfa69a93d2915bc57669014b58d66a9ee7d761509d50b66486d42f8",
    url = "https://github.com/coinbase/mesh-cli/releases/download/v0.10.3/rosetta-cli-0.10.3-linux-amd64.tar.gz",
)

# ruff, python linter & formatter

http_archive(
    name = "ruff-x86_64-linux",
    build_file = "@//third_party:BUILD.ruff.bazel",
    sha256 = "7edce7075bf6d43b1ef2a9383b76a43310bbf5d70fa4471330fd5aaf655192b0",
    strip_prefix = "ruff-x86_64-unknown-linux-gnu",
    url = "https://github.com/astral-sh/ruff/releases/download/0.6.8/ruff-x86_64-unknown-linux-gnu.tar.gz",
)

http_archive(
    name = "ruff-aarch64-darwin",
    build_file = "@//third_party:BUILD.ruff.bazel",
    sha256 = "e554d55281391138e44b30ccd38c666388e4aeb05417c9ffb98a6cbb014aef0d",
    strip_prefix = "ruff-aarch64-apple-darwin",
    url = "https://github.com/astral-sh/ruff/releases/download/0.6.8/ruff-aarch64-apple-darwin.tar.gz",
)

http_archive(
    name = "ruff-x86_64-darwin",
    build_file = "@//third_party:BUILD.ruff.bazel",
    sha256 = "44039cea2aed4787cedcda0c35e5b352530d6ca2178f39c8bd4ff63526c43aef",
    strip_prefix = "ruff-x86_64-apple-darwin",
    url = "https://github.com/astral-sh/ruff/releases/download/0.6.8/ruff-x86_64-apple-darwin.tar.gz",
)

http_archive(
    name = "rclone-x86_64-darwin",
    build_file = "@//third_party:BUILD.rclone.bazel",
    sha256 = "0a9a107ba911bf6bd3c61ad5160a379ac7c81a1b63498e12efcccb4676c65361",
    strip_prefix = "rclone-v1.69.2-osx-amd64",
    url = "https://github.com/rclone/rclone/releases/download/v1.69.2/rclone-v1.69.2-osx-amd64.zip",
)

http_archive(
    name = "rclone-x86_64-linux",
    build_file = "@//third_party:BUILD.rclone.bazel",
    sha256 = "14aaed7163df57894c96f8aca94757f19065f9cb3cb8a84ff9c33234271e1d69",
    strip_prefix = "rclone-v1.69.2-linux-amd64",
    url = "https://github.com/rclone/rclone/releases/download/v1.69.2/rclone-v1.69.2-linux-amd64.zip",
)

http_archive(
    name = "trivy-x86_64-linux",
    build_file = "@//third_party:BUILD.trivy.bazel",
    sha256 = "ebc1dd4d4c0594028d6a501dfc1a73d56add20b29d3dee5ab6e64aac94b1d526",
    url = "https://github.com/aquasecurity/trivy/releases/download/v0.35.0/trivy_0.35.0_Linux-64bit.tar.gz",
)

http_archive(
    name = "trivy-aarch64-darwin",
    build_file = "@//third_party:BUILD.trivy.bazel",
    sha256 = "343fb01737e886bde797f30e5e6359fc1a7b7e1e9807f0e62ae3aea3f9508a1a",
    url = "https://github.com/aquasecurity/trivy/releases/download/v0.35.0/trivy_0.35.0_macOS-ARM64.tar.gz",
)

http_archive(
    name = "trivy-x86_64-darwin",
    build_file = "@//third_party:BUILD.trivy.bazel",
    sha256 = "165c501451ab91a486678107c34bfb7b0b9e117c8ed5bba746ebda31923d9330",
    url = "https://github.com/aquasecurity/trivy/releases/download/v0.35.0/trivy_0.35.0_macOS-64bit.tar.gz",
)

http_archive(
    name = "dfx-x86_64-darwin",
    build_file = "@//third_party:BUILD.dfx.bazel",
    sha256 = "be1079c5f48e4bb88c2421f65b501040250a13a4ea57c6ccc1d3edf17812f674",
    url = "https://github.com/dfinity/sdk/releases/download/0.29.2/dfx-0.29.2-x86_64-darwin.tar.gz",
)

http_archive(
    name = "dfx-x86_64-linux",
    build_file = "@//third_party:BUILD.dfx.bazel",
    sha256 = "d1473ae15ece44e782f0f2f8ac586ead349fe434189df8b587eb738becce0138",
    url = "https://github.com/dfinity/sdk/releases/download/0.29.2/dfx-0.29.2-x86_64-linux.tar.gz",
)

http_archive(
    name = "dfx-aarch64-darwin",
    build_file = "@//third_party:BUILD.dfx.bazel",
    sha256 = "c97b3975f3c72c20f016f7ef4d394fea5bb7e7d849dd77f6ab0ea0361ad6276c",
    url = "https://github.com/dfinity/sdk/releases/download/0.29.2/dfx-0.29.2-aarch64-darwin.tar.gz",
)

http_archive(
    name = "dfx-aarch64-linux",
    build_file = "@//third_party:BUILD.dfx.bazel",
    sha256 = "9da909e8a3cbcb938cfe8502afab87ec61e75c5744025cd0a18b621695c38a5e",
    url = "https://github.com/dfinity/sdk/releases/download/0.29.2/dfx-0.29.2-aarch64-linux.tar.gz",
)

http_file(
    name = "didc-x86_64-linux",
    downloaded_file_path = "didc",
    executable = True,
    sha256 = "1ed8f69036438217c0672097bba75aaf91e6851847d378ea4e0064377d8939fa",
    url = "https://github.com/dfinity/candid/releases/download/2023-11-16/didc-linux64",
)

http_file(
    name = "didc-x86_64-darwin",
    downloaded_file_path = "didc",
    executable = True,
    sha256 = "5df9a457c5ede103c7d017c23a4c1abce4d17db50442a9407724a9006db2f710",
    url = "https://github.com/dfinity/candid/releases/download/2023-11-16/didc-macos",
)

# pebble & pebble dns server for Boundary Nodes ACME tests

http_archive(
    name = "pebble-aarch64-darwin",
    build_file = "@//third_party:BUILD.pebble.bazel",
    sha256 = "39e07d63dc776521f2ffe0584e5f4f081c984ac02742c882b430891d89f0c866",
    strip_prefix = "pebble-darwin-arm64/darwin/arm64",
    url = "https://github.com/letsencrypt/pebble/releases/download/v2.8.0/pebble-darwin-arm64.tar.gz",
)

http_archive(
    name = "pebble-x86_64-darwin",
    build_file = "@//third_party:BUILD.pebble.bazel",
    sha256 = "9b9625651f8ce47706235179503fec149f8f38bce2b2554efe8c0f2a021f877c",
    strip_prefix = "pebble-darwin-amd64/darwin/amd64",
    url = "https://github.com/letsencrypt/pebble/releases/download/v2.8.0/pebble-darwin-amd64.tar.gz",
)

http_archive(
    name = "pebble-aarch64-linux",
    build_file = "@//third_party:BUILD.pebble.bazel",
    sha256 = "0e70f2537353f61cbf06aa54740bf7f7bb5f963ba00e909f23af5f85bc13fd1a",
    strip_prefix = "pebble-linux-arm64/linux/arm64",
    url = "https://github.com/letsencrypt/pebble/releases/download/v2.8.0/pebble-linux-arm64.tar.gz",
)

http_archive(
    name = "pebble-x86_64-linux",
    build_file = "@//third_party:BUILD.pebble.bazel",
    sha256 = "34595d915bbc2fc827affb3f58593034824df57e95353b031c8d5185724485ce",
    strip_prefix = "pebble-linux-amd64/linux/amd64",
    url = "https://github.com/letsencrypt/pebble/releases/download/v2.8.0/pebble-linux-amd64.tar.gz",
)

http_archive(
    name = "pebble-challtestsrv-aarch64-darwin",
    build_file = "@//third_party:BUILD.pebble-challtestsrv.bazel",
    sha256 = "1bc5a6cfa062d9756e98d67825daf67f61dd655bcb6025efca2138fe836c9bbc",
    strip_prefix = "pebble-challtestsrv-darwin-arm64/darwin/arm64",
    url = "https://github.com/letsencrypt/pebble/releases/download/v2.8.0/pebble-challtestsrv-darwin-arm64.tar.gz",
)

http_archive(
    name = "pebble-challtestsrv-x86_64-darwin",
    build_file = "@//third_party:BUILD.pebble-challtestsrv.bazel",
    sha256 = "3d1343b1bbe892145fd2da70be36e67b149e482fbff897e109b8053f4f790f40",
    strip_prefix = "pebble-challtestsrv-darwin-amd64/darwin/amd64",
    url = "https://github.com/letsencrypt/pebble/releases/download/v2.8.0/pebble-challtestsrv-darwin-amd64.tar.gz",
)

http_archive(
    name = "pebble-challtestsrv-aarch64-linux",
    build_file = "@//third_party:BUILD.pebble-challtestsrv.bazel",
    sha256 = "99a276aac8ceac121859b799708218e6dc57d7ca1dc1b8b5b586246b3c4160e6",
    strip_prefix = "pebble-challtestsrv-linux-arm64/linux/arm64",
    url = "https://github.com/letsencrypt/pebble/releases/download/v2.8.0/pebble-challtestsrv-linux-arm64.tar.gz",
)

http_archive(
    name = "pebble-challtestsrv-x86_64-linux",
    build_file = "@//third_party:BUILD.pebble-challtestsrv.bazel",
    sha256 = "a817449d1f05ae58bcb7bf073b4cebe5d31512f859ba4b83951bd825d28d2114",
    strip_prefix = "pebble-challtestsrv-linux-amd64/linux/amd64",
    url = "https://github.com/letsencrypt/pebble/releases/download/v2.8.0/pebble-challtestsrv-linux-amd64.tar.gz",
)

## shfmt, for formatting bash code

http_file(
    name = "shfmt-x86_64-linux",
    downloaded_file_path = "shfmt",
    executable = True,
    sha256 = "5741a02a641de7e56b8da170e71a97e58050d66a3cf485fb268d6a5a8bb74afb",
    url = "https://github.com/mvdan/sh/releases/download/v3.6.0/shfmt_v3.6.0_linux_amd64",
)

http_file(
    name = "shfmt-aarch64-darwin",
    downloaded_file_path = "shfmt",
    executable = True,
    sha256 = "633f242246ee0a866c5f5df25cbf61b6af0d5e143555aca32950059cf13d91e0",
    url = "https://github.com/mvdan/sh/releases/download/v3.6.0/shfmt_v3.6.0_darwin_arm64",
)

http_file(
    name = "shfmt-x86_64-darwin",
    downloaded_file_path = "shfmt",
    executable = True,
    sha256 = "b8c9c025b498e2816b62f0b717f6032e9ab49e725a45b8205f52f66318f17185",
    url = "https://github.com/mvdan/sh/releases/download/v3.6.0/shfmt_v3.6.0_darwin_amd64",
)

# Management canister candid interface

http_file(
    name = "management_canister_did",
    downloaded_file_path = "ic.did",
    sha256 = "0e92d8b9c2cf3d3fca166b76b2d3b8a2464d9b2b61117d8b2f63222b388d8dd1",
    url = "https://raw.githubusercontent.com/dfinity/portal/78c93aa37ef17dc67484079d1a4bf58a10a63106/docs/references/_attachments/ic.did",
)

# Mozilla CA certificate store in PEM format
http_file(
    name = "mozilla_root_ca_store",
    downloaded_file_path = "cacert.pem",
    sha256 = "bb1782d281fe60d4a2dcf41bc229abe3e46c280212597d4abcc25bddf667739b",
    url = "https://curl.se/ca/cacert-2024-11-26.pem",
)

mainnet_icos_images = use_repo_rule("//bazel:mainnet-icos-images.bzl", "mainnet_icos_images")

# Mainnet ICOS images
mainnet_icos_images(
    name = "mainnet_latest_hostos_images",
    parts = [
        "hostos",
        "latest_release",
    ],
    path = "//:mainnet-icos-revisions.json",
)

mainnet_icos_images(
    name = "mainnet_latest_hostos_images_dev",
    dev = True,
    parts = [
        "hostos",
        "latest_release",
    ],
    path = "//:mainnet-icos-revisions.json",
)

mainnet_icos_images(
    name = "mainnet_latest_guestos_images",
    parts = [
        "guestos",
        "latest_release",
    ],
    path = "//:mainnet-icos-revisions.json",
)

mainnet_icos_images(
    name = "mainnet_latest_guestos_images_dev",
    dev = True,
    parts = [
        "guestos",
        "latest_release",
    ],
    path = "//:mainnet-icos-revisions.json",
)

mainnet_icos_images(
    name = "mainnet_nns_images",
    parts = [
        "guestos",
        "subnets",
        "tdb26-jop6k-aogll-7ltgs-eruif-6kk7m-qpktf-gdiqx-mxtrf-vb5e6-eqe",
    ],
    path = "//:mainnet-icos-revisions.json",
)

mainnet_icos_images(
    name = "mainnet_nns_images_dev",
    dev = True,
    parts = [
        "guestos",
        "subnets",
        "tdb26-jop6k-aogll-7ltgs-eruif-6kk7m-qpktf-gdiqx-mxtrf-vb5e6-eqe",
    ],
    path = "//:mainnet-icos-revisions.json",
)

mainnet_icos_images(
    name = "mainnet_app_images",
    parts = [
        "guestos",
        "subnets",
        "io67a-2jmkw-zup3h-snbwi-g6a5n-rm5dn-b6png-lvdpl-nqnto-yih6l-gqe",
    ],
    path = "//:mainnet-icos-revisions.json",
)

mainnet_icos_images(
    name = "mainnet_app_images_dev",
    dev = True,
    parts = [
        "guestos",
        "subnets",
        "io67a-2jmkw-zup3h-snbwi-g6a5n-rm5dn-b6png-lvdpl-nqnto-yih6l-gqe",
    ],
    path = "//:mainnet-icos-revisions.json",
)

mainnet_icos_versions = use_repo_rule("//bazel:mainnet-icos-versions.bzl", "mainnet_icos_versions")

mainnet_icos_versions(
    name = "mainnet_icos_versions",
    path = "//:mainnet-icos-revisions.json",
)

os_info = use_repo_rule("//bazel:os_info.bzl", "os_info")

os_info(name = "os_info")

# Set up hermetic cc toolchains for binaries and canisters
toolchains = use_extension("@hermetic_cc_toolchain//toolchain:ext.bzl", "toolchains")

# The use_hermetic_cc setting is added to each toolchain to allow us to opt out
# in favor of system toolchains, when needed.
toolchains.extra_target_settings(settings = ["//bazel:use_hermetic_cc"])
use_repo(toolchains, "zig_sdk")

register_toolchains(
    # Linux toolchains
    "@zig_sdk//toolchain:linux_amd64_gnu.2.31",
    "@zig_sdk//toolchain:linux_arm64_gnu.2.31",

    # macOS toolchains
    # Do not use hermetic toolchains for macOS until we have had a chance to
    # wrap the various system libraries.
    # "@zig_sdk//toolchain:darwin_amd64",
    # "@zig_sdk//toolchain:darwin_arm64",

    # wasm toolchains
    "@zig_sdk//toolchain:none_wasm",

    # These toolchains are only registered locally.
    dev_dependency = True,
)

new_local_repository = use_repo_rule("@bazel_tools//tools/build_defs/repo:local.bzl", "new_local_repository")

# Use libsystemd from the host environment
# Ideally this is pulled hermetically, but as this is only used by infogetty
# within IC images, we have less compatibility to worry about, and packaging it
# this way is easier.
new_local_repository(
    name = "libsystemd",
    build_file = "@//third_party:BUILD.libsystemd.bazel",
    path = "/usr",
)

# Use libvirt from the host environment
# Used for managing virtual machines programmatically.
new_local_repository(
    name = "libvirt",
    build_file = "@//third_party:BUILD.libvirt.bazel",
    path = "/usr",
)

# Mainnet canister references

canisters = use_repo_rule("//bazel:mainnet-canisters.bzl", "canisters")

# We cannot derive the filenames (e.g. "registry-canister.wasm.gz") directly
# from the canister names because we use inconsistent names.
#
# For each new canister defined in the source JSON file (see `path`) a mapping can be added
# from canister name (as per JSON) to filename.
#
# Additionally the `repositories` list GitHub repositories for canisters. If a canister has an
# entry in `repositories`, then the source JSON file must specify a `tag` and the canister
# artifact will be fetched from the tag's release page.
canisters(
    name = "mainnet_canisters",
    filenames = {
        "registry": "registry-canister.wasm.gz",
        "governance": "governance-canister.wasm.gz",
        "governance-canister_test": "governance-canister_test.wasm.gz",
        "ledger": "ledger-canister_notify-method.wasm.gz",
        "archive": "ledger-archive-node-canister.wasm.gz",
        "index": "ic-icp-index-canister.wasm.gz",
        "root": "root-canister.wasm.gz",
        "lifeline": "lifeline_canister.wasm.gz",
        "genesis-token": "genesis-token-canister.wasm.gz",
        "cycles-minting": "cycles-minting-canister.wasm.gz",
        "sns-wasm": "sns-wasm-canister.wasm.gz",
        "ck_btc_archive": "ic-icrc1-archive.wasm.gz",
        "ck_btc_ledger": "ic-icrc1-ledger.wasm.gz",
        "ck_btc_ledger_v1": "ic-icrc1-ledger.wasm.gz",
        "ck_btc_ledger_v2": "ic-icrc1-ledger.wasm.gz",
        "ck_btc_ledger_v2_noledgerversion": "ic-icrc1-ledger.wasm.gz",
        "ck_btc_ledger_v3": "ic-icrc1-ledger.wasm.gz",
        "ck_btc_index": "ic-icrc1-index-ng.wasm.gz",
        "ck_eth_archive": "ic-icrc1-archive-u256.wasm.gz",
        "ck_eth_ledger": "ic-icrc1-ledger-u256.wasm.gz",
        "ck_eth_ledger_v1": "ic-icrc1-ledger-u256.wasm.gz",
        "ck_eth_ledger_v2": "ic-icrc1-ledger-u256.wasm.gz",
        "ck_eth_ledger_v2_noledgerversion": "ic-icrc1-ledger-u256.wasm.gz",
        "ck_eth_ledger_v3": "ic-icrc1-ledger-u256.wasm.gz",
        "ck_eth_index": "ic-icrc1-index-ng-u256.wasm.gz",
        "sns_root": "sns-root-canister.wasm.gz",
        "sns_governance": "sns-governance-canister.wasm.gz",
        "swap": "sns-swap-canister.wasm.gz",
        "sns_ledger": "ic-icrc1-ledger.wasm.gz",
        "sns_ledger_v2": "ic-icrc1-ledger.wasm.gz",
        "sns_archive": "ic-icrc1-archive.wasm.gz",
        "sns_index": "ic-icrc1-index-ng.wasm.gz",
        "node-rewards": "node-rewards-canister.wasm.gz",
        "internet_identity_test": "internet_identity_dev.wasm.gz",
        "nns_dapp_test": "nns-dapp_test.wasm.gz",
        "sns_aggregator_test": "sns_aggregator_dev.wasm.gz",
        "cycles_ledger": "cycles-ledger.wasm.gz",
        "cycles_ledger_index": "ic-icrc1-index-ng-u256.wasm.gz",
        "bitcoin_testnet": "ic-btc-canister.wasm.gz",
        "dogecoin": "ic-doge-canister.wasm.gz",
        "migration": "migration-canister.wasm.gz",
    },
    path = "//:mainnet-canister-revisions.json",
    repositories = {
        "cycles_ledger": "dfinity/cycles-ledger",
        "internet_identity_test": "dfinity/internet-identity",
        "nns_dapp_test": "dfinity/nns-dapp",
        "sns_aggregator_test": "dfinity/nns-dapp",
        "bitcoin_testnet": "dfinity/bitcoin-canister",
        "dogecoin": "dfinity/dogecoin-canister",
    },
)

bazel_dep(name = "rules_motoko", version = "1.0.0")
archive_override(
    module_name = "rules_motoko",
    integrity = "sha256-cheylLgUCNaODuEtYla4/oVrj6F0FMp7nRjui1AvCo4=",
    strip_prefix = "rules_motoko-9b6d6311db8f1c1fe4c24b70414edf149913ae44",
    urls = ["https://github.com/dfinity/rules_motoko/archive/9b6d6311db8f1c1fe4c24b70414edf149913ae44.tar.gz"],
)

motoko = use_extension("@rules_motoko//motoko:extensions.bzl", "motoko")
motoko.toolchain(version = "0.16.3")
